package it.eng.ws.test.useragent;

import org.apache.log4j.Logger;

import it.eng.ws.test.automata.Automata;
import it.eng.ws.test.exceptions.UAExecutionException;
import it.eng.ws.test.logging.LoggingSample;

public class UserAgent implements Runnable {

	private Automata automata = null;
	private static Logger l = null;
	
	public UserAgent(Automata automata){
		this.automata = automata;
		if (l == null)
			l = LoggingSample.getLogger(it.eng.ws.test.useragent.UserAgent.class);
	}
	
	@Override
	public void run() {
		try {
			automata.execute();
		} catch (UAExecutionException e) {
			l.error(e.getMessage(),e);
		}
	}

}
